package 分支和循环.分支练习;

import java.util.Scanner;

public class Challenge4 {

    public static void main(String[] args) {
        Scanner sc=new Scanner(System.in);
        sys:while(true){
            System.out.println("请输入：");
            int op=sc.nextInt();
            switch (op) {
                case 0://退出
                    break sys;
                case 1:
                    System.out.println("行：");
                    int a=sc.nextInt();
                    System.out.println("列：");
                    int b=sc.nextInt();
                    for (int i = 0; i < a; i++) {
                        for (int j = 0; j < b; j++) {
                            System.out.print("*");
                        }
                        System.out.println();
                    }
                    break;
                case 2:
                    System.out.println("高：");
                    int h= sc.nextInt();
                    for (int i = 0; i < h; i++) {//行
                        for (int j = 0; j <= i; j++) {//列
                            System.out.print("*");
                        }
                        System.out.println();
                    }
                    break;
                case 3:
                    System.out.println("高：");
                    int hh= sc.nextInt();
                    for (int i = 1; i <= hh; i++) {//行
                        for (int j = 0; j + i< hh; j++) {//列====空格
                            System.out.print(" ");
                        }

                        for (int j = 0; j < 2*i-1; j++) {//列===星星
                            System.out.print("*");
                        }
                        System.out.println();
                    }
                    break;

            }
        }
    }
}
